@extends('Admin.layouts.common')

@section('content')
    <div class="container myContainer">
        <button class="btn btn-info searchBtn" onclick="$('.search_box').slideToggle();">搜索/筛选</button>
        <div class="search_box">
            <form id="search_form" method="GET">
                
                <label>
                    Uid：<br>
                    <input type="text" name="uid" value="{{$_search['uid']}}">
                </label>
                <?php /*
                <label>
                    推荐码：<br>
                    <input type="text" name="invitation_code" value="{{$_search['invitation_code']}}">
                </label>
                <label>
                    手机号：<br>
                    <input type="text" name="phone" value="{{$_search['phone']}}">
                </label>
                <label>
                    状态：<br>
                    <select name="type">
                        <option value="">全部</option>
                        @foreach($type as $key=>$v)
                        <option value="{{$key}}">{{$v}}</option>
                        @endforeach
                    </select>
                </label>
                */ ?>
                <button class="btn btn-primary" type="submit">&nbsp;&nbsp;确定&nbsp;&nbsp;</button>
            </form>
        </div>

        <div id="order_tag"></div>

        <div class="table-responsive">
            @if (session('success'))
            <div class="alert alert-success" >
                <p>{{ Session('success') }}</p>
            </div>
            @endif
            <table class="table">
                <caption>用户资金流水</caption>
                <thead>
                    <tr>
                        <th>#</th>
                        <th>uid</th>
                        <th>金币</th>
                        <th>汇率</th>
                        <th>金额</th>
                        <th>类型</th>
                        <th>日期</th>
                    </tr>
                </thead>
                <tbody>
                    @if($list!=null)
                    @forelse($list->items() as $item)
                        <tr id="tr_{{$item->id}}">
                            <td>{{ $item->id }}</td>
                            <td>{{ $item->uid }}</td>
                            <td>{{ $item->coin }}</td>
                            <td>{{ $item->rate }}</td>
                            <td>{{ $item->money }}</td>
                            <td>{{ $item->income_type_text }}</td>
                            <td>{{ date('Y/m/d H:i:s',$item->time) }}</td>
                        </tr>
                    @empty
                        <tr><td class="text-center" colspan="7">没有数据</td></tr>
                    @endforelse
                    @endif

                </tbody>
            </table>
            <div class="text-center">
                @if($list!=null)
                {{ $list->links() }}
                @endif
            </div>
        </div>

    </div>
@endsection

@section('foot')
<script type="text/javascript">
$.ajaxSetup({
    headers: {
    'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
    }
})

</script>
@endsection